var App = require('app');

App.ChartView = Em.View.extend({

    templateName: 'templates/form/chart',
    didInsertElement: function() {
    	var me = this;
		var context = me.get('context');
		
		if ($("#"+context.eleId).length > 0) {		
			$.jqplot(context.eleId, context.dt, {
	            seriesDefaults: {
	                renderer:$.jqplot.BarRenderer,
	                pointLabels: { show: true, location: 'e', edgeTolerance: -15 },
	                shadowAngle: 135,
			        rendererOptions: {
			            barDirection: 'horizontal'
			        }
	            },
	            axes: {
	                yaxis: {
	                    renderer: $.jqplot.CategoryAxisRenderer,
	                    ticks: context.ticks
	                }
	            }
	        }).replot();
		}
	}
});
